C51 COMPILER V7.06   STC_EEPROM                                                            10/31/2008 13:23:20 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE STC_EEPROM
OBJECT MODULE PLACED IN .\OUT\STC_EEPROM.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE STC_EEPROM.C BROWSE DEBUG OBJECTEXTEND PRINT(.\LST\STC_EEPROM.lst) OBJECT(.
                    -\OUT\STC_EEPROM.obj)

stmt level    source

   1          #include "STC89C51RC_RD_PLUS.h"
   2          #include "DEFINE.h"
   3          
   4          //===============================
   5          
   6          //==============================
   7          
   8          #define ISP_IAP_BYTE_READ   1    
   9          #define ISP_IAP_BYTE_PROGRAM 2   
  10          #define ISP_IAP_SECTOR_ERASE 3   
  11          #define WAIT_TIME        1       
  12          
  13          
  14          uchar isp_read_byte(uint add)
  15          {
  16   1              uchar addh, addl;
  17   1              uchar rdata;
  18   1              add=add+0x2000;
  19   1              addh = add >> 8;
  20   1              addl = add & 0xff;
  21   1              ISP_ADDRH = addh;
  22   1              ISP_ADDRL = addl;
  23   1              EA = 0;
  24   1              ISP_CONTR = WAIT_TIME | 0X80;
  25   1              ISP_CMD = ISP_IAP_BYTE_READ;
  26   1              ISP_TRIG = 0X46;
  27   1              ISP_TRIG = 0XB9;
  28   1              rdata = 0;
  29   1              rdata = ISP_DATA;
  30   1      
  31   1              EA = 1;
  32   1              return(rdata);
  33   1      }
  34          void isp_program_byte(uint add, uchar dat)
  35          {
  36   1              uchar addh, addl;
  37   1              ISP_DATA = dat;
  38   1              add=add+0x2000;
  39   1      
  40   1              addh = add >> 8;
  41   1              addl = add & 0xff;
  42   1              ISP_ADDRH = addh;
  43   1              ISP_ADDRL = addl;
  44   1              EA = 0;
  45   1              ISP_CONTR = WAIT_TIME | 0X80;
  46   1              ISP_CMD = ISP_IAP_BYTE_PROGRAM;
  47   1              ISP_TRIG = 0X46;
  48   1              ISP_TRIG = 0XB9;
  49   1              ACC = 0;
  50   1      
  51   1              EA = 1;
  52   1      }
  53          void isp_erase_sector(uchar  num)
  54          {
C51 COMPILER V7.06   STC_EEPROM                                                            10/31/2008 13:23:20 PAGE 2   

  55   1              
  56   1              uchar addh, addl;
  57   1              num=0;
  58   1              addh = 0x20;
  59   1              addl = 0x00;
  60   1              ISP_ADDRH = addh;
  61   1              ISP_ADDRL = addl;
  62   1              EA = 0;
  63   1              ISP_CONTR = WAIT_TIME | 0X80;
  64   1              ISP_CMD = ISP_IAP_SECTOR_ERASE;
  65   1              ISP_TRIG = 0X46;
  66   1              ISP_TRIG = 0XB9;
  67   1              ACC = 0;
  68   1      
  69   1              EA = 1;
  70   1      }
  71          
  72          
  73          
  74          
  75          
  76          
  77          
  78          
  79          
  80          
  81          
  82          
  83          
  84          
  85          
  86          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =     93    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
